/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package myrandom;

import javax.swing.JLabel;

/**
 *
 * @author sochy
 */
public class Ran implements Runnable {
    
    JLabel txt_random;
    
    Ran(JLabel l){
        this.txt_random = l;
    }

    @Override
    public void run() {

        while (MyRandom.loop) {
            double i = Math.random() * 20;
            long ran = Math.round(i);

            String result = "012" + ran;
            if (ran < 10) {
                result = "0120" + ran;
            }
            txt_random.setText(result);
        }
    }

}
